package com.kly.sc.api.application.service.trade;

import com.fqgj.common.api.Response;
import com.kly.dto.TOrderDto;
import com.kly.enums.OrderStatus;
import com.kly.service.ProductService;
import com.kly.service.TOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ApiOrderService {
    @Autowired
    TOrderService tOrderService;

    @Autowired
    ProductService productService;


    public Response updateOrder(TOrderDto tOrderDto){
        tOrderDto.setStatus(OrderStatus.PAID.getStatus());
        Response<String> stringResponse = tOrderService.updateOrder(tOrderDto);
        if (stringResponse.isSuccess()){
            return Response.ok();
        }else {
            return Response.error("Failed to update order");
        }
    };
}
